From 5a8267dfaec8c097deac7646ae2fdc5dffdb790c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 6 Sep 2020 20:46:42 -0400 Subject: [PATCH] text: Set the hotspot for the drag icon This makes the drag icon align properly with the dragged text at the beginning of the drag. --- gtk/gtktext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 7e2f2308eb..4fa9a77b21 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -2986,7 +2986,9 @@ gtk_text_drag_gesture_update (GtkGestureDrag *gesture, g_signal_connect (drag, "cancel", G_CALLBACK (dnd_cancel_cb), self); paintable = gtk_text_util_create_drag_icon (widget, text, -1); - gtk_drag_icon_set_from_paintable (drag, paintable, ranges[0], 0); + gtk_drag_icon_set_from_paintable (drag, paintable, + (priv->drag_start_x - ranges[0]), + priv->drag_start_y); g_clear_object (&paintable); priv->drag = drag; -- 2.30.2